﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PasswordReset.aspx.cs" MasterPageFile="~/Layouts/Form.Master" Inherits="Bingosoft.WebApp.Modules.SecurityConsole.User.PasswordReset" %>
<%@ Import Namespace="Bingosoft.Web.Utils" %>

<asp:Content ContentPlaceHolderID="head" ID="idFormTitle" runat="server">
</asp:Content>
<asp:Content ContentPlaceHolderID="Content" ID="idFormMain" runat="server">
    <!-- 页面头部 -->
	<div class="header">
	    <h1>密码重置</h1>
	</div>

    <web:SmartFormView ID="SmartFormView1" runat="server" DataKeyNames="Id" DataSourceID="SmartDataSource1" Width="100%">        
        <InsertItemTemplate></InsertItemTemplate>
        <EditItemTemplate></EditItemTemplate>
        <ItemTemplate>
            <asp:TextBox ID='Id' runat='server' Text='<%# Bind("Id") %>' Width='60%' Visible="false"></asp:TextBox>
          <div>
            <table cellpadding='2' cellspacing='1' width='100%' class="formitem">
                <caption>密码重置</caption>
                <tr>
                    <th>                        
                        用户名称：<font color='red'>*</font>
                    </th>
                    <td>
                        <asp:TextBox ID="Name" runat="server" Text='<%# Bind("Name") %>' Width='80%' validator="required,length[1,50]"></asp:TextBox>                        
                    </td>
                </tr>
                <tr>
                    <th>
                        登录密码：<font color='red'>*</font>
                    </th>
                    <td>
                        <asp:TextBox ID='Password' TextMode="Password" runat='server' Text='' validator="required[密码不能为空],func[checkPassword]" Width='80%'></asp:TextBox>
                    </td>
                </tr> 
                 <tr>
                    
                    <th>
                        确认密码：<font color='red'>*</font>
                    </th>
                    <td>
                        <asp:TextBox ID='ConfirmPassword' TextMode="Password" runat='server' Text='' validator="required[密码不能为空],func[checkPassword]" Width='80%'></asp:TextBox>
                    </td>
                </tr>     
            </table>
        </div>
        </ItemTemplate>
    </web:SmartFormView>
    
    <web:SmartSqlDataSource ID="SmartDataSource1" runat="server" SelectCommand="user.get.user.by.Id" SelectCommandAutoPageWrap="false">
    </web:SmartSqlDataSource>

    <!-- 页脚区域 -->
	<div class="footer">
		<asp:Button ID="Button1" runat="server" Text="确定" 
            OnClientClick="return validateForm();" onclick="ResetPassword"/>        
        <asp:Button ID="CloseButton2" runat="server" Text="关闭" OnClientClick="return closeForm();" />        
	</div>
    

    <script type="text/javascript">
     function checkPassword() {
            var password = $("#<%=ControlHelper.FindControl(this.SmartFormView1, "Password").ClientID %>").val();
            var confirmPassword = $("#<%=ControlHelper.FindControl(this.SmartFormView1, "ConfirmPassword").ClientID %>").val();
            if(password == confirmPassword && password != "" ){
                return {isError:false,errorInfo:""};
            }

             return {isError:true,errorInfo:"密码与确认密码要保持一致!"};
        }

    </script>    

</asp:Content>

    